package com.taijia.chapter8;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class Transform1 {
	public static void main(String[] args) {
		try {
			OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("E:/myeclipse2014/Workspaces/2014/msb_basic/src/com/taijia/chapter8/Transform1.txt",true));
			osw.write("I am a good Man!");
			System.out.println(osw.getEncoding());
			osw.close();
			osw = new OutputStreamWriter(new FileOutputStream("E:/myeclipse2014/Workspaces/2014/msb_basic/src/com/taijia/chapter8/Transform1.txt",true),"ISO-8859-1"); // equals with latin1
			osw.write("I am a good Man!");
			System.out.println(osw.getEncoding());
			osw.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} 
	}
}
